package com.xlh.fgs;

import android.app.Fragment;
import android.content.Context;
import android.graphics.Color;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.xlh.Utils.Constant;
import com.xlh.outside.R;
import com.xlh.view.ColorPickerView;

/**
 * 创建角色页面
 */

public class ColorPickerFragment extends Fragment {


	private Context context;

	public ColorPickerFragment() {
		// TODO Auto-generated constructor stub
	}

	public static final String TAG = ColorPickerFragment.class.getName();

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		return inflater.inflate(R.layout.color_picker_fragment, container, false);


	}



	@Override
	public void onViewCreated(final View view, Bundle savedInstanceState) {
		// TODO Auto-generated method stub



		 ll = (LinearLayout) view.findViewById(R.id.ll_color);
		 tv = (TextView) view.findViewById(R.id.tv_info);

		colorPickerView = new ColorPickerView(getActivity());
		ll.addView(colorPickerView);
		/*
		colorPickerView.setOnColorBackListener(new ColorPickerView.OnColorBackListener() {
			@Override
			public void onColorBack(int a, int r, int g, int b) {
					tv.setText("R：" + r + "\nG：" + g + "\nB：" + b + "\n" + colorPickerView.getStrColor());
					tv.setTextColor(Color.argb(a, r, g, b));
					//Constant.setAppColor();

			}
		});*/



	}


	public String getStringColor(){
		return colorPickerView.getStrColor();
	}

	public void setOnColorBackListener(ColorPickerView.OnColorBackListener e){
		colorPickerView.setOnColorBackListener(e);
	}


	public LinearLayout ll;
	public TextView tv;
	public ColorPickerView colorPickerView;






}
